<template>
	<div>
		<!--Banner区域-->
		<div class="banner" @click="handleBannerClick">
			<img 
				class="banner-img"
				src="//img1.qunarzz.com/sight/p0/1812/6e/6e53feee4290b8c4a3.img.jpg_600x330_7e548fc7.jpg" 
				alt="" />
			<div class="banner-info">
				<div class="banner-icon">
					<span class="iconfont">&#xe60f;</span>
					<em>{{this.gallaryImgs.length}}</em>
				</div>
				<div class="banner-title">{{this.sightName}}</div>
			</div>
			<div class="banner-linear"></div>
		</div>
		<!--图片画廊-->
		<fade-animation>
			<common-gallary 
				:imgs="gallaryImgs" 
				v-show="showGallary"
				@close="handleGallaryClose"
			>
			</common-gallary>
		</fade-animation>
	</div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/Fade'
export default {
	name: "DetailBanner",
	props: {
		sightName: String,
		bannerImg: String,
		gallaryImgs: Array
	},
	data () {
		return {
			showGallary: false
		}
	},
	components: {
		CommonGallary,
		FadeAnimation
	},
	methods: {
		handleBannerClick () {
			this.showGallary = true
		},
		handleGallaryClose () {
			this.showGallary = false
		}
	}
}
</script>

<style lang="stylus" scoped>
	.banner
		position: relative
		overflow: hidden
		height: 0
		padding-bottom: 55%
		.banner-img
			width: 100%
		.banner-info
			position: absolute
			left: 0.12rem
			right: 0.2rem
			bottom: 0.14rem
			.banner-title
				color: #fff
				font-size: 0.18rem
				text-shadow: 0 1px 2px rgba(0,0,0,0.70)
			.banner-icon
				position: relative
				width: .6rem
				height: .2rem
				border-radius: .2rem
				background-color: rgba(0,0,0,.5)
				margin-bottom: .08rem	
				color: #fff
				text-align: center
				font-size: .12rem
				line-height: .2rem
				.iconfont
					position: absolute
				em
					margin-left: .2rem
		.banner-linear
			position: absolute
			left: 0
			bottom: 0
			height: .14rem
			width: 100%
			background: linear-gradient(to top,rgba(0,0,0,0.6),rgba(0,0,0,0))
</style>
